@echo off
rem This script configures the Dcmtk packages for being included, compiled and used within the TotalDcmLister project (MS Visual Studio 14 2015). 
rem IMPORTANT: 
rem Please make sure to:
rem   - install CMake (http://www.cmake.org) to your system
rem   - add the CMake's binary location (e.g. C:\Program Files\CMake\bin\) to your %PATH% environment variable

rem ******** some variable to be used ********************************************************
set SOURCE_DIR=%cd%\dcmtk-3.6.1-src
set BUILD_DIR=%cd%\dcmtk-3.6.1-make
set OUTPUT_DIR=%cd%\dcmtk-3.6.1-lib
set OUTPUT_DIR_DEBUG=%OUTPUT_DIR%\Debug
set OUTPUT_DIR_RELEASE=%OUTPUT_DIR%\Release

rem ******** check for source directory ******************************************************
if not exist %SOURCE_DIR% (
    echo Expected Dcmtk source directory not found. [%SOURCE_DIR%]
    goto FINALLY
)
 
rem ******** create and change to make directory *********************************************
if not exist %BUILD_DIR% (
   mkdir %BUILD_DIR% 
)
if not exist %BUILD_DIR% (
    echo Failed to create CMake Build directory not found. [%BUILD_DIR%]
    goto FINALLY
)
cd %BUILD_DIR%

rem ******** call to cmake *******************************************************************
cmake -G"Visual Studio 14 2015" -DDCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS=on -DDCMTK_WIDE_CHAR_MAIN_FUNCTION=on -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=%OUTPUT_DIR_RELEASE% -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=%OUTPUT_DIR_RELEASE% -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=%OUTPUT_DIR_RELEASE% -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=%OUTPUT_DIR_DEBUG% -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG=%OUTPUT_DIR_DEBUG% -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=%OUTPUT_DIR_DEBUG% %SOURCE_DIR%
